home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / POSTSCPT / GSVIEW / EPSTOOL / EPSTOOL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-22  |  4.0 KB  |  163 lines

  1. /* Copyright (C) 1993, 1994, Russell Lang.  All rights reserved.
  2.   
  3.   This file is part of GSview.
  4.   
  5.   This program is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the GSview Free Public Licence 
  9.   (the "Licence") for full details.
  10.   
  11.   Every copy of GSview must include a copy of the Licence, normally in a 
  12.   plain ASCII text file named LICENCE.  The Licence grants you the right 
  13.   to copy, modify and redistribute GSview, but only under certain conditions 
  14.   described in the Licence.  Among other things, the Licence requires that 
  15.   the copyright notice and this notice be preserved on all copies.
  16. */
  17.  
  18. /* epstool.h */
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <ctype.h>
  23. #include <time.h>
  24.  
  25. #if defined(HAVE_UNISTD_H)
  26. #include <unistd.h>
  27. #endif
  28.  
  29. #ifdef __EMX__
  30. #define GSCOMMAND "gsos2"
  31. #define BYTE unsigned char    /* 8 bits unsigned */
  32. #define WORD  unsigned short    /* 16 bits unsigned */
  33. #define DWORD unsigned int    /* 32 bits unsigned */
  34. #define UINT  unsigned int    /* native unsigned */
  35. #define LONG  int        /* 32 bits signed */
  36. #define BOOL  int
  37. #define GVFAR 
  38. #define GVHUGE 
  39. #define READBIN  "rb"
  40. #define WRITEBIN "wb"
  41. #define MAXSTR 256
  42. #define DIRSEP '\\'
  43. #define EOLSTR "\r\n"
  44. #define PACKED
  45. #include <io.h>
  46. #include <fcntl.h>
  47. #endif
  48.  
  49. #ifdef MSDOS
  50. #define GSCOMMAND "gsos2"
  51. #define BYTE unsigned char
  52. #define WORD  unsigned short
  53. #define DWORD unsigned long
  54. #define UINT  unsigned int
  55. #define LONG  long
  56. #define BOOL  int
  57. #define GVFAR far
  58. #define GVHUGE huge
  59. #define READBIN  "rb"
  60. #define WRITEBIN "wb"
  61. #define MAXSTR 126
  62. #define DIRSEP '\\'
  63. #define EOLSTR "\r\n"
  64. #define PACKED
  65. #include <alloc.h>
  66. #include <dir.h>
  67. #include <io.h>
  68. #include <fcntl.h>
  69. #endif
  70.  
  71. #if defined(UNIX) || defined(__UNIX) || defined(__unix)
  72. #define GSCOMMAND "gs"
  73. #define BYTE unsigned char
  74. #define WORD  unsigned short
  75. #define DWORD unsigned int
  76. #define UINT  unsigned int
  77. #define LONG  int
  78. #define BOOL  int
  79. #define GVFAR 
  80. #define GVHUGE
  81. #define READBIN  "r"
  82. #define WRITEBIN "w"
  83. #define MAXSTR 256
  84. #define DIRSEP '/'
  85. #define EOLSTR "\n"
  86. #define PACKED __attribute__ ((packed))
  87. #if defined(__NeXT__)
  88. extern char *getwd (char *pathname);
  89. #define getcwd(s,n) getwd(s)
  90. #endif
  91. /* char *getcwd(char *, int); */
  92. #define stricmp(s1, s2) strcasecmp(s1, s2)
  93. #ifndef SEEK_SET
  94. #define SEEK_SET 0
  95. #define SEEK_END 2
  96. #endif
  97. #endif
  98.  
  99. #include "ps.h"
  100. #include "gvceps.h"
  101.  
  102. #define TRUE 1
  103. #define FALSE 0
  104.  
  105. #ifndef min
  106. #define min(x,y)  ( (x) < (y) ? (x) : (y) )
  107. #endif
  108. #ifndef max
  109. #define max(x,y)  ( (x) > (y) ? (x) : (y) )
  110. #endif
  111.  
  112. extern char oname[MAXSTR];
  113. extern char upname[MAXSTR];
  114. extern char szScratch[];
  115. extern char szAppName[];
  116.  
  117. typedef struct tagPSBBOX {
  118.     int    llx;
  119.     int    lly;
  120.     int    urx;
  121.     int    ury;
  122.     int    valid;
  123. } PSBBOX;
  124.  
  125. typedef struct document PSDOC;
  126.  
  127. typedef struct tagPSFILE {
  128.     BOOL    ignore_dsc;    /* true if DSC to be ignored */
  129.     PSDOC    *doc;        /* DSC structure.  NULL if not DSC */
  130.     int     pagenum;    /* current page number */
  131.     char     name[MAXSTR];    /* name of selected document file */
  132.     FILE     *file;        /* selected file */
  133.     int     preview;    /* preview type IDS_EPSF, IDS_EPSI, etc. */
  134. } PSFILE;
  135.  
  136. typedef struct tagOPTION {
  137.     float    xdpi;
  138.     float    ydpi;
  139. } OPTION;
  140.  
  141. FILE * gp_open_scratch_file(const char *prefix, char *fname, const char *mode);
  142. void gserror(UINT id, char *str, UINT icon, int sound);
  143. void pserror(char *str);
  144. char * _getcwd(char *dirname, int size);
  145. void play_sound(int i);
  146.  
  147. /* temporary kludges */
  148. extern PSDOC *doc;
  149. extern PSFILE psfile;
  150. extern OPTION option;
  151. #define MB_ICONEXCLAMATION 1
  152. #define SOUND_ERROR 1
  153. #define IDM_EXTRACTPS  1
  154. #define IDM_EXTRACTPRE 2
  155. #define IDM_MAKEEPST   3
  156. #define IDM_MAKEEPST4  4
  157. #define IDS_TOPICEDIT 1
  158. #define COPY_BUF_SIZE 4096
  159.  
  160. /* error messages */
  161. #define IDS_NOPREVIEW 1
  162. #define IDS_EPSUSERINVALID 2
  163.